package com.springboot.project.service.impl;

import com.springboot.project.dao.CityDao;
import com.springboot.project.domain.City;
import com.springboot.project.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liupenghui
 * @date 2018/7/10
 * @desc：
 */
@Service
public class CityServiceImpl implements ICityService {

    @Autowired
    private CityDao cityDao;

    @Override
    public City findCityByName(String cityName) {
        City city = cityDao.findByName(cityName);
        if (city ==null){
            city = new City();
            city.setDescription("查询结果为空");
        }
        return city;
    }
}
